package com.sleep.psy.external_server.business.adjustment.service;

import com.sleep.psy.external_server.business.adjustment.entity.AdjustmentPlan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sleep.psy.external_server.business.adjustment.entity.vo.GenerateSleepPlanReq;
import com.sleep.psy.external_server.result.Result;

import java.util.List;

/**
 * <p>
 * 调节方案 服务类
 * </p>
 *
 * @author wenliguo
 * @since 2025-08-12
 */
public interface AdjustmentPlanService extends IService<AdjustmentPlan> {

    /**
     * 生成条件方案
     * @author wenliguo
     * @date 2025/6/10 14:54
     * @param req 请求参数
     * @return com.sleep.psy.main_server.result.Result
     */
    Result generateSleepPlan(GenerateSleepPlanReq req);

    /**
     * 通过用户id和测评记录ids获取多个调节方案
     * @param userId 用户id
     * @param ids    测评记录列表
     * @return java.util.List<com.sleep.psy.main_server.business2.adjustment.entity.AdjustmentPlan>
     * @author wenliguo
     * @date 2025/6/17 14:55
     */
    List<AdjustmentPlan> selectPlans(Long userId, List<Long> ids);

    /**
     * 通过用户id和测评记录id获取有效的调节方案
     * @author wenliguo
     * @date 2025/6/9 11:48
     * @param userId 用户id
     * @param recordId 测评记录id
     * @return com.sleep.psy.main_server.business2.adjustment.entity.AdjustmentPlan
     */
    AdjustmentPlan selectPlan(Long userId, Long recordId);

    /**
     * 通过用户id和测评记录id获取有效的调节方案(存在计划详情)
     * @author wenliguo
     * @date 2025/8/18 10:25
     * @param userId 用户id
     * @param recordId 测评id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result selectValidPlan(Long userId, Long recordId);


    /**
     * 通过用户id获取有效的调节方案
     * @author wenliguo
     * @date 2025/8/25 14:42
     * @param userId 用户id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result selectValidPlanByUserId(Long userId);
}
